#pragma once
#include "../Object/Object.h"
#include "Rect.h"
#include <vector>
#include "../Object/World.h"

class World;

class QuadTree
{
public:
	QuadTree() {
		
	}
	void insert(Object* o);
	void subdevide();
	void merge();
	void remove(Object* o);
	void update();

	std::vector<Object*> getObjs();

	World* world;

	int max_ObjectCount=2;
	int max_Depth = 9;
	Rect boundary;
	int depth = 1;
	std::vector<Object*> objs;
	bool devided=false;
	QuadTree* ne;
	QuadTree* nw;
	QuadTree* se;
	QuadTree* sw;
	QuadTree* root;
};

